import {defineStore} from "pinia"
export const useStore=defineStore("main",{
	persist: true,
	state:()=>({
		isLogin:false,
		token:"",
		username:"",
		id:null
	}),
	actions:{
		login(token){
			this.isLogin=true
			this.token=token
		},
		setUserInfo({username,id}){
			this.username=username
			this.id=id
		},
		exitLogin(){
			console.log("退出登录:");
			this.isLogin=false
			this.token=""
			this.username=""
			this.id=null
		}

	}
})